
import React from 'react';
import { KeepAlive } from 'react-activation';

interface KeepAliveWrapperProps {
  id: string;
  children: React.ReactNode;
}

// 客户端组件包装器，用于解决React-Activation在Next.js App Router中的兼容性问题
const KeepAliveWrapper: React.FC<KeepAliveWrapperProps> = ({ id, children }) => {
  return (
    <KeepAlive id={id} name={id}>
      {children}
    </KeepAlive>
  );
};

export default KeepAliveWrapper; 